package main.java.io;

import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;

public class WriteStringDemo {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos = new FileOutputStream("E:\\51_home-work\\homework\\src\\main\\resource\\test.txt");
        String line  = "手牵手一步两步三步四步望着天，看星星一颗两颗三颗四颗连成线";
        byte[] data = line.getBytes(StandardCharsets.UTF_8);
        fos.write(data);
        System.out.println("写入完毕");
        fos.close();
    }
}
